/**
 * FleetHighlight.java
 *
 * Roslan's Remake of MOO in 3D using Ardor3D
 * (C) 2011 Roslan Amir. All rights reserved.
 */

package com.roslan.games.moo3d.spatial;

import com.ardor3d.math.Vector3;
import com.ardor3d.renderer.state.MaterialState;
import com.ardor3d.scenegraph.Node;
import com.ardor3d.scenegraph.shape.Sphere;
import com.ardor3d.scenegraph.shape.Sphere.TextureMode;
import com.ardor3d.scenegraph.shape.Torus;
import com.roslan.games.moo3d.GameData;

/**
 * This class represents the node for highlighting the selected fleet.
 * 
 * @author Roslan Amir
 * @version 1.0 - Feb 24, 2011
 */
public class FleetHighlight extends Node {

	/**
	 * Default no-arg constructor.
	 */
	public FleetHighlight() {
		super("FleetHighlightNode");

		//// final Line line = (Line) (((Line) starHighlight.getChild(0)).makeCopy(true));
		// final double[][] tuples = HexGridUtils.getAllSegmentVertices(null);
		// final ReadOnlyVector3[] vertices = {
		// new Vector3(tuples[0][0], tuples[0][1], 0), new Vector3(tuples[1][0], tuples[1][1], 0),
		// new Vector3(tuples[1][0], tuples[1][1], 0), new Vector3(tuples[2][0], tuples[2][1], 0),
		// new Vector3(tuples[2][0], tuples[2][1], 0), new Vector3(tuples[3][0], tuples[3][1], 0),
		// new Vector3(tuples[3][0], tuples[3][1], 0), new Vector3(tuples[4][0], tuples[4][1], 0),
		// new Vector3(tuples[4][0], tuples[4][1], 0), new Vector3(tuples[5][0], tuples[5][1], 0),
		// new Vector3(tuples[5][0], tuples[5][1], 0), new Vector3(tuples[0][0], tuples[0][1], 0) };
		// final Line line = new Line("StarHighlightLine", vertices, null, null, null);
		// line.updateModelBound();
		// line.setName("FleetHighlightLine");
		// line.setLineWidth(3);
		// this.attachChild(line);

		final Torus torus = new Torus("FleetHighlightTorus", 32, 32, 0.03, FleetNode.HORIZONTAL_GAP * 1.5);
		this.attachChild(torus);

		final Sphere ball = new Sphere("FleetHighlightBall", new Vector3(FleetNode.HORIZONTAL_GAP * 1.5, 0, 0), 32, 32, 0.075, TextureMode.Linear);
		this.attachChild(ball);

		final MaterialState renderState = new MaterialState();
		renderState.setAmbient(GameData.COLOR_MOO2_ORANGE);
		this.setRenderState(renderState);
	}

}
